﻿@model IPagination<Currency>
@using BankCreditPortfolio.DAL.Entities
@using BankCreditPortfolio.DAL.Services
@using MvcContrib.Pagination
@using MvcContrib.UI.Grid
@using MvcContrib.UI.Pager

@{
    ViewBag.Title = "Currencies";
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<link href="@Url.Content("~/Content/Styles/customgrid.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/Admin/Styles/forms.css")" rel="stylesheet" type="text/css" />
@using (Html.BeginForm())
{
    <div>

    <h2>Currencies</h2>

    @{
        if (Model.Count() > 0)
        {
            Html.Grid(Model).Columns(column =>
                {
                    column.For(x => Html.ActionLink(x.Title, "Currency", new { currencyId = x.CurrencyId })).Named("Title");
                    @*column.For(x => (new CurrencyService()).IsUsed(x) ? MvcHtmlString.Empty : Html.ActionLink("Delete...", "DeleteCurrency", new {currencyId = x.CurrencyId})).Named("Delete");*@
                }).Render();
            <br />
            @Html.Pager(Model).First("First").Last("Last").Next("Next").Previous("Previous")
        }
        else
        {
            <div>There is no currencies.</div>
        }
    }

    </div>
}
